<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--
@html_name: 16set数据结构
@description: The past cannot be redeemed, the future can be changed.
@author: Jason Black
@create: 2023/6/26 09:12:07
-->
<script>
  // 新数据类型 set  --> 数据会自动去重
  // 创建方式  Set() /  Set(param)
  let set1 = new Set()
  console.log(set1)
  let set2 = new Set(['Jason','Black','Jackson','Jack'])
  console.log(set2)
  // set api
  console.log(set2.size)
  set2.add('jack')
  console.log(set2)
  set2.delete('Jason')
  console.log(set2)
  set2.clear()
  console.log(set2)
</script>
</body>
</html>